package com.wn.service.other;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2022 -08-31
 * @desc
 *
 *  给队列中存储对象
 */
@Component
public class WorkProduct{

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendMsg(String exchangeName,String routing,Object msg){

       rabbitTemplate.convertAndSend(
                exchangeName,
                routing,
                msg
        );

    }

}
